package com.atguigu.gmall.product.service.impl;

import com.atguigu.gmall.product.entity.BaseCategory1;
import com.atguigu.gmall.product.entity.BaseCategory2;
import com.atguigu.gmall.product.entity.BaseCategory3;
import com.atguigu.gmall.product.mapper.BaseCategory2Mapper;
import com.atguigu.gmall.product.mapper.BaseCategoryMapper;
import com.atguigu.gmall.product.service.BaseCategory2Service;
import com.atguigu.gmall.product.service.BaseCategory3Service;
import com.atguigu.gmall.product.service.BaseCategoryService;
import com.atguigu.gmall.product.vo.CategoryTreeVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BaseCategory1Serviceimpl extends ServiceImpl<BaseCategoryMapper, BaseCategory1> implements BaseCategoryService {

    @Autowired
    BaseCategory2Service baseCategory2Service;
    @Autowired
    BaseCategory3Service baseCategory3Service;

    @Autowired
    BaseCategory2Mapper baseCategory2Mapper;

    @Override
    public List<CategoryTreeVo> getCategoryTree() {

        List<CategoryTreeVo> categoryTreeVos =  baseCategory2Mapper.getCategoryTree();

        return categoryTreeVos;
    }



    @Override
    public CategoryTreeVo getCategoryTreeWithC3Id(Long c3Id) {
        CategoryTreeVo vo = baseCategory2Mapper.getCategoryTreeWithC3Id(c3Id);
        return vo;
    }
}
